$(document).ready(function () {

// hide #back-top first
$("#back-top").hide();

// fade in #back-top
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
	$('#back-top').fadeIn();
} else {
	$('#back-top').fadeOut();
}
});

// scroll body to 0px on click
$('#back-top a').click(function () {
$('body,html').animate({
	scrollTop: 0
}, 800);
return false;
});
});
		
// TABS
$.fn.mTabs = function(){ 
	//Default Action
	$(this).find(".tab_content").hide(); //Hide all content
	$(this).find("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(this).find(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$(this).parent().parent().find("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(this).parent().parent().find(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).show(); //Fade in the active content
		return false;
	});
};//end function
$("div[class^='mTabs']").mTabs(); //Run function on any div with class name of "mTabs"
	
// TABLE ROW
$(".post-content tr:first, .post-content thead tr").addClass("first");
$(".post-content tr:even").addClass("even");
$(".post-content tr:odd").addClass("odd");
	
// Cross-Browser HTML5 Placeholder Text
if (!Modernizr.input.placeholder) {

$('[placeholder]').focus(function () {
		var input = $(this);
		if (input.val() == input.attr('placeholder')) {
				input.val('');
				input.removeClass('placeholder');
		}
}).blur(function () {
		var input = $(this);
		if (input.val() == '' || input.val() == input.attr('placeholder')) {
				input.addClass('placeholder');
				input.val(input.attr('placeholder'));
		}
}).blur();
$('[placeholder]').parents('form').submit(function () {
		$(this).find('[placeholder]').each(function () {
				var input = $(this);
				if (input.val() == input.attr('placeholder')) {
						input.val('');
				}
		})
});

}

}); //close doc ready

// DT
var mes=new Array();
mes[1]="Jan"; mes[2]="Feb"; mes[3]="Mar"; mes[4]="Apr"; mes[5]="May"; mes[6]="Jun";
mes[7]="Jul"; mes[8]="Aug"; mes[9]="Sep"; mes[10]="Oct"; mes[11]="Nov"; mes[12]="Dec";
function calendar(cual) {
  var verCero;
  var lafecha = cual.split('/');
  verCero=lafecha[1].substr(0,1); if (verCero == "0") { lafecha[1]=lafecha[1].substr(1) }
  fday = "<div class='datebg'></div><span class='day'>"+lafecha[1]+"</span>";
  fmonth = "<span class='m-y'><span class='month'>"+mes[lafecha[0]]+"</span>";
  fyear = "<span class='year'>"+lafecha[2]+"</span></span>";
  document.write(fday+fmonth+fyear);
}